3.46 \(\int (f+g x) (a+b \log (c (d+e x)^n))^2 \, dx\)

Optimal. Leaf size=186 \[ \frac{(d+e x) (e f-d g) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e^2}-\frac{b g n (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 e^2}+\frac{g (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 e^2}-\frac{2 a b n x (e f-d g)}{e}-\frac{2 b^2 n (d+e x) (e f-d g) \log \left (c (d+e x)^n\right )}{e^2}+\frac{b^2 g n^2 (d+e x)^2}{4 e^2}+\frac{2 b^2 n^2 x (e f-d g)}{e} \]

[Out]

(-2*a*b*(e*f - d*g)*n*x)/e + (2*b^2*(e*f - d*g)*n^2*x)/e + (b^2*g*n^2*(d + e*x)^2)/(4*e^2) - (2*b^2*(e*f - d*g
)*n*(d + e*x)*Log[c*(d + e*x)^n])/e^2 - (b*g*n*(d + e*x)^2*(a + b*Log[c*(d + e*x)^n]))/(2*e^2) + ((e*f - d*g)*
(d + e*x)*(a + b*Log[c*(d + e*x)^n])^2)/e^2 + (g*(d + e*x)^2*(a + b*Log[c*(d + e*x)^n])^2)/(2*e^2)

________________________________________________________________________________________

Rubi [A]  time = 0.163694, antiderivative size = 186, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 7, integrand size = 22, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.318, Rules used = {2401, 2389, 2296, 2295, 2390, 2305, 2304} \[ \frac{(d+e x) (e f-d g) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e^2}-\frac{b g n (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 e^2}+\frac{g (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 e^2}-\frac{2 a b n x (e f-d g)}{e}-\frac{2 b^2 n (d+e x) (e f-d g) \log \left (c (d+e x)^n\right )}{e^2}+\frac{b^2 g n^2 (d+e x)^2}{4 e^2}+\frac{2 b^2 n^2 x (e f-d g)}{e} \]

Antiderivative was successfully verified.

[In]

Int[(f + g*x)*(a + b*Log[c*(d + e*x)^n])^2,x]

[Out]

(-2*a*b*(e*f - d*g)*n*x)/e + (2*b^2*(e*f - d*g)*n^2*x)/e + (b^2*g*n^2*(d + e*x)^2)/(4*e^2) - (2*b^2*(e*f - d*g
)*n*(d + e*x)*Log[c*(d + e*x)^n])/e^2 - (b*g*n*(d + e*x)^2*(a + b*Log[c*(d + e*x)^n]))/(2*e^2) + ((e*f - d*g)*
(d + e*x)*(a + b*Log[c*(d + e*x)^n])^2)/e^2 + (g*(d + e*x)^2*(a + b*Log[c*(d + e*x)^n])^2)/(2*e^2)

Rule 2401

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_)*((f_.) + (g_.)*(x_))^(q_.), x_Symbol] :> Int[Exp
andIntegrand[(f + g*x)^q*(a + b*Log[c*(d + e*x)^n])^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p}, x] && NeQ[
e*f - d*g, 0] && IGtQ[q, 0]

Rule 2389

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.), x_Symbol] :> Dist[1/e, Subst[Int[(a + b*Log[c*
x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, n, p}, x]

Rule 2296

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*Log[c*x^n])^p, x] - Dist[b*n*p, In
t[(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{a, b, c, n}, x] && GtQ[p, 0] && IntegerQ[2*p]

Rule 2295

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2390

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_) + (g_.)*(x_))^(q_.), x_Symbol] :> Dist[1/
e, Subst[Int[((f*x)/d)^q*(a + b*Log[c*x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p, q}, x]
 && EqQ[e*f - d*g, 0]

Rule 2305

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*Lo
g[c*x^n])^p)/(d*(m + 1)), x] - Dist[(b*n*p)/(m + 1), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rule 2304

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*Log[c*x^
n]))/(d*(m + 1)), x] - Simp[(b*n*(d*x)^(m + 1))/(d*(m + 1)^2), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rubi steps

\begin{align*} \int (f+g x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \, dx &=\int \left (\frac{(e f-d g) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e}+\frac{g (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e}\right ) \, dx\\ &=\frac{g \int (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \, dx}{e}+\frac{(e f-d g) \int \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \, dx}{e}\\ &=\frac{g \operatorname{Subst}\left (\int x \left (a+b \log \left (c x^n\right )\right )^2 \, dx,x,d+e x\right )}{e^2}+\frac{(e f-d g) \operatorname{Subst}\left (\int \left (a+b \log \left (c x^n\right )\right )^2 \, dx,x,d+e x\right )}{e^2}\\ &=\frac{(e f-d g) (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e^2}+\frac{g (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 e^2}-\frac{(b g n) \operatorname{Subst}\left (\int x \left (a+b \log \left (c x^n\right )\right ) \, dx,x,d+e x\right )}{e^2}-\frac{(2 b (e f-d g) n) \operatorname{Subst}\left (\int \left (a+b \log \left (c x^n\right )\right ) \, dx,x,d+e x\right )}{e^2}\\ &=-\frac{2 a b (e f-d g) n x}{e}+\frac{b^2 g n^2 (d+e x)^2}{4 e^2}-\frac{b g n (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 e^2}+\frac{(e f-d g) (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e^2}+\frac{g (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 e^2}-\frac{\left (2 b^2 (e f-d g) n\right ) \operatorname{Subst}\left (\int \log \left (c x^n\right ) \, dx,x,d+e x\right )}{e^2}\\ &=-\frac{2 a b (e f-d g) n x}{e}+\frac{2 b^2 (e f-d g) n^2 x}{e}+\frac{b^2 g n^2 (d+e x)^2}{4 e^2}-\frac{2 b^2 (e f-d g) n (d+e x) \log \left (c (d+e x)^n\right )}{e^2}-\frac{b g n (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 e^2}+\frac{(e f-d g) (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e^2}+\frac{g (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 e^2}\\ \end{align*}

Mathematica [A]  time = 0.0758791, size = 144, normalized size = 0.77 \[ \frac{4 (d+e x) (e f-d g) \left (a+b \log \left (c (d+e x)^n\right )\right )^2-8 b n (e f-d g) \left (e x (a-b n)+b (d+e x) \log \left (c (d+e x)^n\right )\right )+2 g (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2+b g n \left (b e n x (2 d+e x)-2 (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )\right )}{4 e^2} \]

Antiderivative was successfully verified.

[In]

Integrate[(f + g*x)*(a + b*Log[c*(d + e*x)^n])^2,x]

[Out]

(4*(e*f - d*g)*(d + e*x)*(a + b*Log[c*(d + e*x)^n])^2 + 2*g*(d + e*x)^2*(a + b*Log[c*(d + e*x)^n])^2 - 8*b*(e*
f - d*g)*n*(e*(a - b*n)*x + b*(d + e*x)*Log[c*(d + e*x)^n]) + b*g*n*(b*e*n*x*(2*d + e*x) - 2*(d + e*x)^2*(a +
b*Log[c*(d + e*x)^n])))/(4*e^2)

________________________________________________________________________________________

Maple [C]  time = 0.633, size = 2616, normalized size = 14.1 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((g*x+f)*(a+b*ln(c*(e*x+d)^n))^2,x)

[Out]

I/e*Pi*ln(e*x+d)*b^2*d*f*n*csgn(I*c)*csgn(I*c*(e*x+d)^n)^2+I/e*Pi*ln(e*x+d)*b^2*d*f*n*csgn(I*(e*x+d)^n)*csgn(I
*c*(e*x+d)^n)^2+1/2*a^2*g*x^2+a^2*f*x+1/4*b^2*g*n^2*x^2-1/2*a*b*g*n*x^2+ln(c)^2*b^2*f*x+1/2*ln(c)^2*b^2*g*x^2-
1/2*b*(I*Pi*b*e^2*g*x^2*csgn(I*c)*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)-2*I*Pi*b*e^2*f*x*csgn(I*c)*csgn(I*c*(e
*x+d)^n)^2-2*I*Pi*b*e^2*f*x*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)^2+2*I*Pi*b*e^2*f*x*csgn(I*c)*csgn(I*(e*x+d)^
n)*csgn(I*c*(e*x+d)^n)-I*Pi*b*e^2*g*x^2*csgn(I*c)*csgn(I*c*(e*x+d)^n)^2-I*Pi*b*e^2*g*x^2*csgn(I*(e*x+d)^n)*csg
n(I*c*(e*x+d)^n)^2+2*I*Pi*b*e^2*f*x*csgn(I*c*(e*x+d)^n)^3+I*Pi*b*e^2*g*x^2*csgn(I*c*(e*x+d)^n)^3-2*ln(c)*b*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n)*csgn(I*c*(e*x+d)^n)-1/2*I*ln(c)*Pi*b^2*g*x^2*csgn(I*c)*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)+1/4*I
*Pi*b^2*g*n*x^2*csgn(I*c)*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)-I*ln(c)*Pi*b^2*f*x*csgn(I*c)*csgn(I*(e*x+d)^n)
*csgn(I*c*(e*x+d)^n)-1/2*I*Pi*a*b*g*x^2*csgn(I*c)*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)-I*Pi*a*b*f*x*csgn(I*c)
*csgn(I*(e*x+d)^n)*csgn(I*c*(e*x+d)^n)+1/2*I/e^2*Pi*ln(e*x+d)*b^2*d^2*g*n*csgn(I*c*(e*x+d)^n)^3-I/e*Pi*ln(e*x+
d)*b^2*d*f*n*csgn(I*c*(e*x+d)^n)^3-1/2*I/e*Pi*b^2*d*g*n*x*csgn(I*c*(e*x+d)^n)^3

________________________________________________________________________________________

Maxima [A]  time = 1.23617, size = 424, normalized size = 2.28 \begin{align*} \frac{1}{2} \, b^{2} g x^{2} \log \left ({\left (e x + d\right )}^{n} c\right )^{2} - 2 \, a b e f n{\left (\frac{x}{e} - \frac{d \log \left (e x + d\right )}{e^{2}}\right )} - \frac{1}{2} \, a b e g n{\left (\frac{2 \, d^{2} \log \left (e x + d\right )}{e^{3}} + \frac{e x^{2} - 2 \, d x}{e^{2}}\right )} + a b g x^{2} \log \left ({\left (e x + d\right )}^{n} c\right ) + b^{2} f x \log \left ({\left (e x + d\right )}^{n} c\right )^{2} + \frac{1}{2} \, a^{2} g x^{2} + 2 \, a b f x \log \left ({\left (e x + d\right )}^{n} c\right ) -{\left (2 \, e n{\left (\frac{x}{e} - \frac{d \log \left (e x + d\right )}{e^{2}}\right )} \log \left ({\left (e x + d\right )}^{n} c\right ) + \frac{{\left (d \log \left (e x + d\right )^{2} - 2 \, e x + 2 \, d \log \left (e x + d\right )\right )} n^{2}}{e}\right )} b^{2} f - \frac{1}{4} \,{\left (2 \, e n{\left (\frac{2 \, d^{2} \log \left (e x + d\right )}{e^{3}} + \frac{e x^{2} - 2 \, d x}{e^{2}}\right )} \log \left ({\left (e x + d\right )}^{n} c\right ) - \frac{{\left (e^{2} x^{2} + 2 \, d^{2} \log \left (e x + d\right )^{2} - 6 \, d e x + 6 \, d^{2} \log \left (e x + d\right )\right )} n^{2}}{e^{2}}\right )} b^{2} g + a^{2} f x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x+f)*(a+b*log(c*(e*x+d)^n))^2,x, algorithm="maxima")

[Out]

1/2*b^2*g*x^2*log((e*x + d)^n*c)^2 - 2*a*b*e*f*n*(x/e - d*log(e*x + d)/e^2) - 1/2*a*b*e*g*n*(2*d^2*log(e*x + d
)/e^3 + (e*x^2 - 2*d*x)/e^2) + a*b*g*x^2*log((e*x + d)^n*c) + b^2*f*x*log((e*x + d)^n*c)^2 + 1/2*a^2*g*x^2 + 2
*a*b*f*x*log((e*x + d)^n*c) - (2*e*n*(x/e - d*log(e*x + d)/e^2)*log((e*x + d)^n*c) + (d*log(e*x + d)^2 - 2*e*x
 + 2*d*log(e*x + d))*n^2/e)*b^2*f - 1/4*(2*e*n*(2*d^2*log(e*x + d)/e^3 + (e*x^2 - 2*d*x)/e^2)*log((e*x + d)^n*
c) - (e^2*x^2 + 2*d^2*log(e*x + d)^2 - 6*d*e*x + 6*d^2*log(e*x + d))*n^2/e^2)*b^2*g + a^2*f*x

________________________________________________________________________________________

Fricas [B]  time = 2.14151, size = 851, normalized size = 4.58 \begin{align*} \frac{{\left (b^{2} e^{2} g n^{2} - 2 \, a b e^{2} g n + 2 \, a^{2} e^{2} g\right )} x^{2} + 2 \,{\left (b^{2} e^{2} g n^{2} x^{2} + 2 \, b^{2} e^{2} f n^{2} x +{\left (2 \, b^{2} d e f - b^{2} d^{2} g\right )} n^{2}\right )} \log \left (e x + d\right )^{2} + 2 \,{\left (b^{2} e^{2} g x^{2} + 2 \, b^{2} e^{2} f x\right )} \log \left (c\right )^{2} + 2 \,{\left (2 \, a^{2} e^{2} f +{\left (4 \, b^{2} e^{2} f - 3 \, b^{2} d e g\right )} n^{2} - 2 \,{\left (2 \, a b e^{2} f - a b d e g\right )} n\right )} x - 2 \,{\left ({\left (4 \, b^{2} d e f - 3 \, b^{2} d^{2} g\right )} n^{2} +{\left (b^{2} e^{2} g n^{2} - 2 \, a b e^{2} g n\right )} x^{2} - 2 \,{\left (2 \, a b d e f - a b d^{2} g\right )} n - 2 \,{\left (2 \, a b e^{2} f n -{\left (2 \, b^{2} e^{2} f - b^{2} d e g\right )} n^{2}\right )} x - 2 \,{\left (b^{2} e^{2} g n x^{2} + 2 \, b^{2} e^{2} f n x +{\left (2 \, b^{2} d e f - b^{2} d^{2} g\right )} n\right )} \log \left (c\right )\right )} \log \left (e x + d\right ) - 2 \,{\left ({\left (b^{2} e^{2} g n - 2 \, a b e^{2} g\right )} x^{2} - 2 \,{\left (2 \, a b e^{2} f -{\left (2 \, b^{2} e^{2} f - b^{2} d e g\right )} n\right )} x\right )} \log \left (c\right )}{4 \, e^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x+f)*(a+b*log(c*(e*x+d)^n))^2,x, algorithm="fricas")

[Out]

1/4*((b^2*e^2*g*n^2 - 2*a*b*e^2*g*n + 2*a^2*e^2*g)*x^2 + 2*(b^2*e^2*g*n^2*x^2 + 2*b^2*e^2*f*n^2*x + (2*b^2*d*e
*f - b^2*d^2*g)*n^2)*log(e*x + d)^2 + 2*(b^2*e^2*g*x^2 + 2*b^2*e^2*f*x)*log(c)^2 + 2*(2*a^2*e^2*f + (4*b^2*e^2
*f - 3*b^2*d*e*g)*n^2 - 2*(2*a*b*e^2*f - a*b*d*e*g)*n)*x - 2*((4*b^2*d*e*f - 3*b^2*d^2*g)*n^2 + (b^2*e^2*g*n^2
 - 2*a*b*e^2*g*n)*x^2 - 2*(2*a*b*d*e*f - a*b*d^2*g)*n - 2*(2*a*b*e^2*f*n - (2*b^2*e^2*f - b^2*d*e*g)*n^2)*x -
2*(b^2*e^2*g*n*x^2 + 2*b^2*e^2*f*n*x + (2*b^2*d*e*f - b^2*d^2*g)*n)*log(c))*log(e*x + d) - 2*((b^2*e^2*g*n - 2
*a*b*e^2*g)*x^2 - 2*(2*a*b*e^2*f - (2*b^2*e^2*f - b^2*d*e*g)*n)*x)*log(c))/e^2

________________________________________________________________________________________

Sympy [A]  time = 4.24247, size = 561, normalized size = 3.02 \begin{align*} \begin{cases} a^{2} f x + \frac{a^{2} g x^{2}}{2} - \frac{a b d^{2} g n \log{\left (d + e x \right )}}{e^{2}} + \frac{2 a b d f n \log{\left (d + e x \right )}}{e} + \frac{a b d g n x}{e} + 2 a b f n x \log{\left (d + e x \right )} - 2 a b f n x + 2 a b f x \log{\left (c \right )} + a b g n x^{2} \log{\left (d + e x \right )} - \frac{a b g n x^{2}}{2} + a b g x^{2} \log{\left (c \right )} - \frac{b^{2} d^{2} g n^{2} \log{\left (d + e x \right )}^{2}}{2 e^{2}} + \frac{3 b^{2} d^{2} g n^{2} \log{\left (d + e x \right )}}{2 e^{2}} - \frac{b^{2} d^{2} g n \log{\left (c \right )} \log{\left (d + e x \right )}}{e^{2}} + \frac{b^{2} d f n^{2} \log{\left (d + e x \right )}^{2}}{e} - \frac{2 b^{2} d f n^{2} \log{\left (d + e x \right )}}{e} + \frac{2 b^{2} d f n \log{\left (c \right )} \log{\left (d + e x \right )}}{e} + \frac{b^{2} d g n^{2} x \log{\left (d + e x \right )}}{e} - \frac{3 b^{2} d g n^{2} x}{2 e} + \frac{b^{2} d g n x \log{\left (c \right )}}{e} + b^{2} f n^{2} x \log{\left (d + e x \right )}^{2} - 2 b^{2} f n^{2} x \log{\left (d + e x \right )} + 2 b^{2} f n^{2} x + 2 b^{2} f n x \log{\left (c \right )} \log{\left (d + e x \right )} - 2 b^{2} f n x \log{\left (c \right )} + b^{2} f x \log{\left (c \right )}^{2} + \frac{b^{2} g n^{2} x^{2} \log{\left (d + e x \right )}^{2}}{2} - \frac{b^{2} g n^{2} x^{2} \log{\left (d + e x \right )}}{2} + \frac{b^{2} g n^{2} x^{2}}{4} + b^{2} g n x^{2} \log{\left (c \right )} \log{\left (d + e x \right )} - \frac{b^{2} g n x^{2} \log{\left (c \right )}}{2} + \frac{b^{2} g x^{2} \log{\left (c \right )}^{2}}{2} & \text{for}\: e \neq 0 \\\left (a + b \log{\left (c d^{n} \right )}\right )^{2} \left (f x + \frac{g x^{2}}{2}\right ) & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x+f)*(a+b*ln(c*(e*x+d)**n))**2,x)

[Out]

Piecewise((a**2*f*x + a**2*g*x**2/2 - a*b*d**2*g*n*log(d + e*x)/e**2 + 2*a*b*d*f*n*log(d + e*x)/e + a*b*d*g*n*
x/e + 2*a*b*f*n*x*log(d + e*x) - 2*a*b*f*n*x + 2*a*b*f*x*log(c) + a*b*g*n*x**2*log(d + e*x) - a*b*g*n*x**2/2 +
 a*b*g*x**2*log(c) - b**2*d**2*g*n**2*log(d + e*x)**2/(2*e**2) + 3*b**2*d**2*g*n**2*log(d + e*x)/(2*e**2) - b*
*2*d**2*g*n*log(c)*log(d + e*x)/e**2 + b**2*d*f*n**2*log(d + e*x)**2/e - 2*b**2*d*f*n**2*log(d + e*x)/e + 2*b*
*2*d*f*n*log(c)*log(d + e*x)/e + b**2*d*g*n**2*x*log(d + e*x)/e - 3*b**2*d*g*n**2*x/(2*e) + b**2*d*g*n*x*log(c
)/e + b**2*f*n**2*x*log(d + e*x)**2 - 2*b**2*f*n**2*x*log(d + e*x) + 2*b**2*f*n**2*x + 2*b**2*f*n*x*log(c)*log
(d + e*x) - 2*b**2*f*n*x*log(c) + b**2*f*x*log(c)**2 + b**2*g*n**2*x**2*log(d + e*x)**2/2 - b**2*g*n**2*x**2*l
og(d + e*x)/2 + b**2*g*n**2*x**2/4 + b**2*g*n*x**2*log(c)*log(d + e*x) - b**2*g*n*x**2*log(c)/2 + b**2*g*x**2*
log(c)**2/2, Ne(e, 0)), ((a + b*log(c*d**n))**2*(f*x + g*x**2/2), True))

________________________________________________________________________________________

Giac [B]  time = 1.31445, size = 803, normalized size = 4.32 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((g*x+f)*(a+b*log(c*(e*x+d)^n))^2,x, algorithm="giac")

[Out]

1/2*(x*e + d)^2*b^2*g*n^2*e^(-2)*log(x*e + d)^2 - (x*e + d)*b^2*d*g*n^2*e^(-2)*log(x*e + d)^2 - 1/2*(x*e + d)^
2*b^2*g*n^2*e^(-2)*log(x*e + d) + 2*(x*e + d)*b^2*d*g*n^2*e^(-2)*log(x*e + d) + (x*e + d)*b^2*f*n^2*e^(-1)*log
(x*e + d)^2 + (x*e + d)^2*b^2*g*n*e^(-2)*log(x*e + d)*log(c) - 2*(x*e + d)*b^2*d*g*n*e^(-2)*log(x*e + d)*log(c
) + 1/4*(x*e + d)^2*b^2*g*n^2*e^(-2) - 2*(x*e + d)*b^2*d*g*n^2*e^(-2) - 2*(x*e + d)*b^2*f*n^2*e^(-1)*log(x*e +
 d) + (x*e + d)^2*a*b*g*n*e^(-2)*log(x*e + d) - 2*(x*e + d)*a*b*d*g*n*e^(-2)*log(x*e + d) - 1/2*(x*e + d)^2*b^
2*g*n*e^(-2)*log(c) + 2*(x*e + d)*b^2*d*g*n*e^(-2)*log(c) + 2*(x*e + d)*b^2*f*n*e^(-1)*log(x*e + d)*log(c) + 1
/2*(x*e + d)^2*b^2*g*e^(-2)*log(c)^2 - (x*e + d)*b^2*d*g*e^(-2)*log(c)^2 + 2*(x*e + d)*b^2*f*n^2*e^(-1) - 1/2*
(x*e + d)^2*a*b*g*n*e^(-2) + 2*(x*e + d)*a*b*d*g*n*e^(-2) + 2*(x*e + d)*a*b*f*n*e^(-1)*log(x*e + d) - 2*(x*e +
 d)*b^2*f*n*e^(-1)*log(c) + (x*e + d)^2*a*b*g*e^(-2)*log(c) - 2*(x*e + d)*a*b*d*g*e^(-2)*log(c) + (x*e + d)*b^
2*f*e^(-1)*log(c)^2 - 2*(x*e + d)*a*b*f*n*e^(-1) + 1/2*(x*e + d)^2*a^2*g*e^(-2) - (x*e + d)*a^2*d*g*e^(-2) + 2
*(x*e + d)*a*b*f*e^(-1)*log(c) + (x*e + d)*a^2*f*e^(-1)